/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 *
 * @author Andres
 */
@Entity
@Table(name = "INFORMACIONCONGRESO", catalog = "", schema = "PROYECTO", uniqueConstraints = {
    @UniqueConstraint(columnNames = {"ETAPA_CODIGOETAPA"})})
@NamedQueries({
    @NamedQuery(name = "Informacioncongreso.findAll", query = "SELECT i FROM Informacioncongreso i"),
    @NamedQuery(name = "Informacioncongreso.findByMision", query = "SELECT i FROM Informacioncongreso i WHERE i.mision = :mision"),
    @NamedQuery(name = "Informacioncongreso.findByVision", query = "SELECT i FROM Informacioncongreso i WHERE i.vision = :vision"),
    @NamedQuery(name = "Informacioncongreso.findByEslogan", query = "SELECT i FROM Informacioncongreso i WHERE i.eslogan = :eslogan"),
    @NamedQuery(name = "Informacioncongreso.findByDescripcion", query = "SELECT i FROM Informacioncongreso i WHERE i.descripcion = :descripcion"),
    @NamedQuery(name = "Informacioncongreso.findByCodigoinformacion", query = "SELECT i FROM Informacioncongreso i WHERE i.codigoinformacion = :codigoinformacion")})
public class Informacioncongreso implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "MISION", nullable = false, length = 350)
    private String mision;
    @Basic(optional = false)
    @Column(name = "VISION", nullable = false, length = 350)
    private String vision;
    @Basic(optional = false)
    @Column(name = "ESLOGAN", nullable = false, length = 350)
    private String eslogan;
    @Column(name = "DESCRIPCION", length = 350)
    private String descripcion;
    @Id
    @Basic(optional = false)
    @Column(name = "CODIGOINFORMACION", nullable = false)
    private Integer codigoinformacion;
    @JoinColumn(name = "ETAPA_CODIGOETAPA", referencedColumnName = "CODIGOETAPA", nullable = false)
    @OneToOne(optional = false, fetch = FetchType.EAGER)
    private Etapa etapa;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "informacioncongreso", fetch = FetchType.EAGER)
    private List<Objetivo> objetivoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "informacioncongreso", fetch = FetchType.EAGER)
    private List<Tema> temaList;

    public Informacioncongreso() {
    }

    public Informacioncongreso(Integer codigoinformacion) {
        this.codigoinformacion = codigoinformacion;
    }

    public Informacioncongreso(Integer codigoinformacion, String mision, String vision, String eslogan) {
        this.codigoinformacion = codigoinformacion;
        this.mision = mision;
        this.vision = vision;
        this.eslogan = eslogan;
    }

    public String getMision() {
        return mision;
    }

    public void setMision(String mision) {
        this.mision = mision;
    }

    public String getVision() {
        return vision;
    }

    public void setVision(String vision) {
        this.vision = vision;
    }

    public String getEslogan() {
        return eslogan;
    }

    public void setEslogan(String eslogan) {
        this.eslogan = eslogan;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Integer getCodigoinformacion() {
        return codigoinformacion;
    }

    public void setCodigoinformacion(Integer codigoinformacion) {
        this.codigoinformacion = codigoinformacion;
    }

    public Etapa getEtapa() {
        return etapa;
    }

    public void setEtapa(Etapa etapa) {
        this.etapa = etapa;
    }

    public List<Objetivo> getObjetivoList() {
        return objetivoList;
    }

    public void setObjetivoList(List<Objetivo> objetivoList) {
        this.objetivoList = objetivoList;
    }

    public List<Tema> getTemaList() {
        return temaList;
    }

    public void setTemaList(List<Tema> temaList) {
        this.temaList = temaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigoinformacion != null ? codigoinformacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Informacioncongreso)) {
            return false;
        }
        Informacioncongreso other = (Informacioncongreso) object;
        if ((this.codigoinformacion == null && other.codigoinformacion != null) || (this.codigoinformacion != null && !this.codigoinformacion.equals(other.codigoinformacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Informacioncongreso[codigoinformacion=" + codigoinformacion + "]";
    }

}
